package com.example.mybatis20240101.mapper;

import com.example.mybatis20240101.model.UserInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;

import java.util.ArrayList;
import java.util.List;

@Mapper
public interface UserInfoMapper {
//    @Insert("<script>" +
//            "insert into userinfo(username,`password`,age," +
//            "<if test='gender!=null'>gender,</if>" +
//            "phone)" +
//            "values(#{username},#{password},#{age}," +
//            "<if test='gender!=null'>gender,</if>" +
//            "#{phone})" +
//            "</script>")
    Integer insertByCondition(UserInfo userInfo);

    UserInfo selectByCondition(UserInfo userInfo);

    void updateByCondition(UserInfo userInfo);

    void deleteByCondition(List<Integer> list);

    ArrayList<UserInfo> selectAll();
}
